#define  _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<algorithm>
using namespace std;
string fun(int x,int n)
{
	string s;
	while (x)
	{
		char a = (x % n)+'0';
		if (a >= 10+'0')
		{
			a = a + 7;
		}
		s += a;
		x = x / n;
	}
	reverse(s.begin(),s.end());
	return s;
}
int main()
{
	int n;
	cin >> n;
	char j2, i2;
	for (int i = 1; i < n; i++)
	{
		for (int j = 1; j <= i; j++)
		{
			int x = i * j;
			string s = fun(x,n);
			j2 = j + '0';
			i2 = i + '0';
			if (j >= 10)
			{
				j2 += 7;
			}
			if (i >= 10)
				i2 += 7;
			
			cout << i2 << '*' << j2 << '=' << s <<' ';

		}
		cout << endl;
	}
	return 0;
}